package com.orm;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created by lirance on 16/4/6.
 */
public class ServiceCalledEntityPK implements Serializable {
    private int uId;
    private int wsId;
    private int rtt;
    private int dataSize;

    @Column(name = "uId", nullable = false, insertable = true, updatable = true)
    @Id
    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    @Column(name = "wsId", nullable = false, insertable = true, updatable = true)
    @Id
    public int getWsId() {
        return wsId;
    }

    public void setWsId(int wsId) {
        this.wsId = wsId;
    }

    @Column(name = "rtt", nullable = false, insertable = true, updatable = true)
    @Id
    public int getRtt() {
        return rtt;
    }

    public void setRtt(int rtt) {
        this.rtt = rtt;
    }

    @Column(name = "dataSize", nullable = false, insertable = true, updatable = true)
    @Id
    public int getDataSize() {
        return dataSize;
    }

    public void setDataSize(int dataSize) {
        this.dataSize = dataSize;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ServiceCalledEntityPK that = (ServiceCalledEntityPK) o;

        if (uId != that.uId) return false;
        if (wsId != that.wsId) return false;
        if (rtt != that.rtt) return false;
        if (dataSize != that.dataSize) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uId;
        result = 31 * result + wsId;
        result = 31 * result + rtt;
        result = 31 * result + dataSize;
        return result;
    }
}
